<div class="child-container" admin-child-data>
  <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">child</strong> / <small>Table</small></div>
      </div>

      <div class="am-g">
         <div class="am-u-sm-6 am-u-md-2">
          <div class="am-form-group child-page-list">
          <select  id="page-size">
          <option value="10">10</option>
          <option value="20">20</option>
          <option value="50">50</option>
          <option value="-1">All</option>
        </select>
      </div>
    </div>
        <div class="am-u-sm-12 am-u-md-3">
          <div class="am-input-group am-input-group-sm child-filter">
            <input type="text" class="am-form-field search-child" ng-keyup="searchChildren($event)" ng-model="search">
            <span class="am-input-group-btn">
              <button class="am-btn am-btn-default" type="button">Search</button>
            </span>
          </div>
        </div>
      </div>

      <div class="am-g">
        <div class="am-u-sm-12">
            <table class="am-table am-table-striped am-table-hover" id="child-table">
              <thead>
                <tr>
                  <th class="table-id">UserId</th>
                  <th class="table-title">Name</th>
                  <th class="table-title">Exp</th>
                  <th class="table-title">Level</th>
                  <th class="table-title">Coin</th>
                  <th class="table-title">SessionRestrictions</th>
                  <th class="table-title">ParentEmail</th>
                  <th class="table-set">Operation</th>
                </tr>
            </thead>
            <tbody child-detail-data>
              <tr ng-repeat="child in children.result">
                <td class="childUserId">{{child.userId}}</td>
                <td class="childName">{{child.name}}</td>
                <td class="childExp">{{child.exp}}</td>
                <td class="childLevel">
                    <button ng-click="editLevel(child)" class="am-btn am-btn-success child-level">{{child.level}}</button>
                </td>
                <td class="childCoin">
                    <a ng-click="editCoin(child)"> <button class="am-btn am-btn-success child-level">{{child.coin}} </button></a>
                </td>
                <td class="childSessionCount">
                   <a ng-click="editallowSessionCount(child)"><button class="am-btn am-btn-success child-level">{{child.allowSessionCount}}</button></a>
                </td>
                <td class="childParentEmail">{{child.parentEmail}}</td>
                <td>
                  <div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs"  style="width: 122px;">

                      <button class="am-btn am-btn-default am-active info" date-oper=""
                      ng-click="info(child)"
                      style="width: 121px;"> 
                       <span class="">InventorysInfo</span>
                      </button>
                      <br />
                      <button class="am-btn am-active" ng-class="child.accountState==1?
                        'am-btn-success':'am-btn-default'"
                      id="{{child.userId}}" date-oper="accountState"
                      ng-click="userOper(child)"
                      style="width: 121px;"> 
                       <span class="child.accountState" ng-bind="child.accountState==1?' Enable ':'Disable'"
                          id="a{{child.userId}}" ></span>
                      </button>
                      <br />
                      <button class="am-btn am-btn-default am-active" date-oper=""
                      ng-click="userClear(child)"
                      style="width: 121px;"> 
                       <span class="child.accountState">Clear Data</span>
                      </button>
                      <br />
                      <button class="am-btn am-btn-default am-active viewMission" date-oper=""
                      ng-click="viewMission(child)"
                      style="width: 121px;"> 
                       <span class="child.accountState">MissionData</span>
                      </button>
                      <br />

                      <button class="am-btn am-btn-default am-active find-atem" date-oper=""
                      ng-click="findAtem(child)"
                      style="width: 121px;"> 
                       <span class="">Add Items</span>
                      </button>
                      <br />
                      <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" ng-click="remove(child)" style="width: 121px;"> Delete</button>
                    </div>
                  </div>
                </td>
              </tr> 
             
            </tbody>
          </table>
            <div class="am-cf">
              Total <span class="child-total-record">0</span> records
        <div class="am-fr">
          <ul class="am-pagination child-pager-container">
          </ul>
        </div>
        </div>
     <hr />
       <p>Attention</p>
     </div>
  </div>
</div>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="view-mission-child-modal" admin-child-mission-data>
  <div class="am-modal-dialog">
    <div class="am-modal-hd">Mission Data
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd">
        <div class="am-u-sm-12 am-u-md-6">
          <div class="am-btn-toolbar left-modal-align">
            <div class="am-btn-group am-btn-group-xs left-modal-align">
              <button class="am-btn am-btn-default am-btn-xs am-hide-sm-only" ng-click="clearAllMission(id)"  id="clearAllMission"></span> ClearAll</button>
            </div>
          </div>
        </div>     
        <div class="am-u-sm-12 am-u-md-3">
          <div class="am-input-group am-input-group-sm child-filter">
            <input type="text" class="am-form-field search-mission" ng-model="searchMission">
            <span class="am-input-group-btn">
              <button class="am-btn am-btn-default" type="button">Search</button>
            </span>
          </div>
        </div>
      </div>
       <table class="am-table am-table-striped am-table-hover table-main" id="view-mission-child-table">
              <thead>
                <tr>
                  <th class="table-id">MissionId</th>
                  <th class="table-title">MissionName</th>
                  <th class="table-title">QuestId</th>
                  <th class="table-title">QuestName</th>
                  <th class="table-title">Score</th>
                  <th class="table-title">Stars</th>
                  <th class="table-set">Operation</th>
                </tr>
            </thead>
            <tbody>
              <tr ng-repeat="mission in missions.result">
                <td class="childUserId">{{mission.missionId}}</td>
                <td class="childName">{{mission.missionName}}</td>
                <td class="childExp">{{mission.questId}}</td>
                <td class="childCoin">{{mission.questName}}</td>
                <td class="childParentEmail">{{mission.score}}</td>
                <td class="childParentEmail">{{mission.star}}</td>
                <td> 
                  <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" ng-click="clearMission(mission)"></span>Clear</button>
                </td>
              </tr> 
             
            </tbody>
          </table>
           <div class="am-cf left-modal-align">
              Total <span class="child-mission-total-record">0</span> records
        <div class="am-fr">
          <ul class="am-pagination child-mission-pager-container">
          </ul>
        </div>
        </div>
    </div>
  </div>
</div>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="edit-childLevel-modal">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">Edit childLevel
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd">
       <form class="am-form" id="edit-childLevel-form" data-am-validator>
        <fieldset>
          <div class="am-form-group">
            <label for="doc-vld-name-2">Level：</label>
            <input type="text" name="parameter" id="doc-vld-name-2" minlength="1" placeholder="Level" ng-model="parameter" required/>
          </div>
          <button class="am-btn am-btn-secondary" data-oper="editLevel" id="editLevel" 
                ng-click="rejust(parameter)"  admin-operate-child>rejust</button>
        </fieldset>
      </form>
    </div>
  </div>
</div>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="edit-child-allowSessionCount-modal">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">Edit AllowSessionCount
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd">
       <form class="am-form" id="edit-childLevel-form" data-am-validator>
        <fieldset>
          <div class="am-form-group">
            <label for="doc-vld-name-2">AllowSessionCount：</label>
            <input type="text" name="allowSessionCount" id="doc-vld-name-2" minlength="1" placeholder="allowSessionCount" ng-model="allowSessionCount" required/>
          </div>
          <button class="am-btn am-btn-secondary" data-oper="editAllowSessionCount" id="editLevel" 
                ng-click="rejustAllowSessionCount(allowSessionCount)"  admin-operate-child>rejust</button>
        </fieldset>
      </form>
    </div>
  </div>
</div>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="edit-childCoin-modal">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">Edit childCoin
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd">
       <form class="am-form" id="edit-childLevel-form" data-am-validator>
        <fieldset>
          <div class="am-form-group">
            <label for="doc-vld-name-2">Coin：</label>
            <input type="text" name="coin" id="doc-vld-name-2" minlength="1" placeholder="coin" ng-model="coin" required/>
          </div>
          <button class="am-btn am-btn-secondary" data-oper="editCoin" id="editCoin" 
                ng-click="rejustDeductCoin(coin)"  admin-operate-child>DeductCoin</button>
          <button class="am-btn am-btn-secondary" data-oper="addCoin" id="addCoin" 
                ng-click="rejustAddCoin(coin)"  admin-operate-child>AddCoin</button>
        </fieldset>
      </form>
    </div>
  </div>
</div>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="edit-sessionRestriction-modal">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">Edit SessionRestrictions
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd">
       <form class="am-form" id="edit-childLevel-form" data-am-validator>
        <fieldset>
          <div class="am-form-group">
            <label for="doc-vld-name-2">SessionRestrictions：</label>
            <input type="text" name="parameter" id="doc-vld-name-2" minlength="1" placeholder="Level" ng-model="parameter" required/>
          </div>
          <button class="am-btn am-btn-secondary" data-oper="editSessionRestriction" id="edit-sessionRestriction" 
                ng-click="rejust()"  admin-operate-child>rejust</button>
        </fieldset>
      </form>
    </div>
  </div>
</div>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="add-Item-modal" admin-child-item-data>
  <div class="am-modal-dialog">
    <div class="am-modal-hd">Item Data
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd" >
       <table class="am-table am-table-striped am-table-hover " id="view-mission-child-table">
              <thead>
                <tr>
                  <td class="select-column"><input type="checkbox" class="select-all-record" /></td>
                  <th class="table-id">ItemId</th>
                  <th class="table-title">Name</th>
                  <th class="table-title">Description</th>
                  <th class="table-title">BuyPrice</th>
                  <th class="table-title">SellPrice</th>
                  <th class="table-title">Tags</th>
                </tr>
            </thead>
            <tbody class="check-select">
              <tr ng-repeat="item in items.result">
                <td class="select-column"><input type="checkbox" name="select-item" 
                          value="{{item.itemId}}" class="select-single-record" /></td>
                <td class="childUserId">{{item.itemId}}</td>
                <td class="childName">{{item.name}}</td>
                <td class="childExp">{{item.description}}</td>
                <td class="childCoin">{{item.buyPrice}}</td>
                <td class="childParentEmail">{{item.sellPrice}}</td>
                <td class="childParentEmail">{{item.tagName}}</td>
              </tr> 
             <tr>
                <td colspan="7"  class="numberinput"> <input type="number" name="number"  id="doc-vld-name-2" minlength="1" placeholder="num" ng-model="num" srequired/>
                 <a class="number"> <button class="am-btn am-btn-success child-level">Add</button></a> </td>
             </tr>
            </tbody>
          </table>
           <div class="am-cf left-modal-align">
              Total <span class="child-item-total-record">0</span> records
              <div class="am-fr">
                  <ul class="am-pagination child-item-pager-container">
                  </ul>
              </div>
          </div>
       
    </div>
  </div>
</div>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="child-inventorys-modal">
  <div class="am-modal-dialog">
    <div admin-child-inventory-data>

    <div class="am-modal-hd">
      <div class="am-cf left-modal-align">total Coin: {{totalCoin}}
      </div>
        <br/>
        <font class="am-modal-color">User Inventorys</font>
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd">
        <table class="am-table am-table-striped am-table-hover table-main" id="inventory-child-table">
              <thead>
                <tr>
                  <th class="table-id">ItemId</th>
                  <th class="table-title">Quantity</th>
                </tr>
            </thead>
            <tbody>
              <tr ng-repeat="inventory in inventorys.result">
                <td class="childUserId">{{inventory.itemId}}</td>
                <td class="childName">{{inventory.quantity}}</td>
              </tr> 
             
            </tbody>
          </table>
           <div class="am-cf left-modal-align">
              Total <span class="child-inventory-total-record">0</span> records
              <div class="am-fr">
                  <ul class="am-pagination child-inventory-pager-container">
                  </ul>
              </div>
          </div>
      </div>
    </div>
     <div admin-child-game-session-data>
    <div class="am-modal-hd">
      <font class="am-modal-color">GameSession</font>
      <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
    </div>
    <div class="am-modal-bd">
        <table class="am-table am-table-striped am-table-hover table-main" id="game-session-child-table">
              <thead>
                <tr>
                  <th class="table-id">GameSessionId</th>
                  <th class="table-title">StartTime</th>
                  <th class="table-title">EndTime</th>
                </tr>
            </thead>
            <tbody>
              <tr ng-repeat="gamesession in gamesessions.result">
                <td class="childUserId">{{gamesession.gameSessionId}}</td>
                <td class="childName">{{gamesession.startTime|date:'yyyy-mm-dd hh:mm:ss'}}</td>
                <td class="childExp">{{gamesession.endTime|date:'yyyy-mm-dd hh:mm:ss'}}</td>
              </tr> 
             
            </tbody>
          </table>
           <div class="am-cf left-modal-align">
              Total <span class="child-game-session-total-record">0</span> records
              <div class="am-fr">
                  <ul class="am-pagination child-game-session-pager-container">
                  </ul>
              </div>
          </div>
      </div>
    </div>
  </div>

</div>

